#ifndef BPAGESWITCH_H
#define BPAGESWITCH_H

#include <QWidget>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QLabel>
#include <QLayout>
#include <QHBoxLayout>
#include <QSizePolicy>
#include <QDebug>
#include <QColor>
#include <QGraphicsOpacityEffect>
#include <QParallelAnimationGroup>
#include <QSequentialAnimationGroup>
#include <QPropertyAnimation>

class BPageSwitch : public QWidget
{
    Q_OBJECT
public:
    BPageSwitch(QWidget* parent = nullptr);
    ~BPageSwitch();

private:
    bool m_isPressed = false;
    bool m_isCenter = false;
    int m_id = -1;      //真实ID
    int m_site = -1;  //当前位置ID
    QWidget* m_bgWight;

public:
    void setCenter();
    void resetCenter();
    bool isCenter() const {return m_isCenter;}
    int getID() { return m_id;}
    void setID(int id) { m_id = id;}
    int getSite() {return m_site;}
    void setSite(int site) {m_site = site;}

protected:
    void enterEvent(QEvent* event) override;
    void leaveEvent(QEvent* event) override;
    void mousePressEvent(QMouseEvent* event) override;
    void mouseReleaseEvent(QMouseEvent* event) override;
    void resizeEvent(QResizeEvent* event) override;

signals:
    void requestCenter(int);
};

#endif // BPAGESWITCH_H
